﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy.Core.Common;
using  FortuneHeavenCommon.DataMap;
using FortuneHeavenDAL;
using FortuneHeavenCommon.Enum;

namespace FortuneHeavenBAL
{
    public class NewsBO : CommonOperate<News>
    {
       
        public NewsDAL _newsDAL;
        public NewsBO()
            : base()
        {
            _newsDAL = new NewsDAL();
        }

        public static List<News> GetNews()
        {
            return new List<News>();
        }

        public List<News> GetNews(int page, int limit, NewsType type)
        {
            return _newsDAL.GetNews(page, limit, type);
        }
        public List<News> GetTopNews(int size, NewsType type)
        {
            return _newsDAL.GetTopNews(size,type);
        } 

        public int GetTotalSize(NewsType type)
        {
            return _newsDAL.GetTotalSize( type);
        }

        public void DeleteNews(int id)
        {
            this.Delete(id.ToString(), true);
        }

        public News GetNewsByTitle(string name)
        {
            return _newsDAL.GetNewsByTitle(name);
        }
    }
}
